<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>view/mine/feedback.html</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">

		<link rel="stylesheet" href="../../css/mui.min.css">
		<link rel="stylesheet" href="../../css/global.css">
		<link rel="stylesheet" href="../../css/style.css">
		<style type="text/css">
			.details_con{
				margin: 15px 0;
			}
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 id="title" class="mui-title">问题反馈</h1>
		</header>
		<div class="mui-content">
			<div class="details_con">
				<div class="clum nobor autoHeight">
					<span class="name">问题和意见<em class="t_red">*</em></span>
					<div class="clear"></div>
					<textarea class="textarea" id="questionsAndComments" style="height: 12.5rem;"  placeholder="请输入问题和意见"></textarea>
				</div>
				<div class="clum">
					<span class="name">联系方式<em class="t_red">*</em></span>
					<input type="text" class="d_ipt" id="contactDetails" placeholder="请输入联系方式" />
				</div>
			</div>
			<div class="btn_box">
				<span class="fl" id="cancelBtn">取消</span>
				<span class="fr red" id="submitBtn">保存</span>
			</div>
			<div style="height: 50px;"></div>
		</div>
		
		<!-- js代码 start -->

		<!-- 基础js start -->
		<script src="../../js/mui.min.js"></script>
		<script src="../../js/utils/h.js"></script>
		<script src="../../js/constant.js"></script>
		<script src="../../js/common.js"></script>
		<script src="../../js/utils/base64.js"></script>
		<script src="../../js/utils/md5.js"></script>
		<script src="../../js/utils/sortMap.js"></script>
		<script src="../../js/utils/http.js"></script>
		<script src="../../js/app.js"></script>
		<!-- 基础js end -->

		<script type="text/javascript" charset="utf-8">
			 //mui初始化
			(function($, doc) {
				$.init();
			
				$.plusReady(function() {
					// 取消
					h("#cancelBtn").tap(function() {
						$.back();
					})
					// 提交保存
					h('#submitBtn').tap(function() {
						var questionsAndComments = h("#questionsAndComments").val();
						var contactDetails = h("#contactDetails").val();
						if (questionsAndComments == "") {
							app.toast("请输入问题和意见");
							return false;
						}
						if (contactDetails == "") {
							app.toast("请输入联系方式");
							return false;
						}
						if(!/^[1][3,4,5,7,8][0-9]{9}$/.test(contactDetails)){
							app.toast("请输入有效联系方式");
							return false;
						}
						
						var postParam = {
							"enginnerId" : app.getUser().enginnerId,
							"questionsAndComments" : questionsAndComments,
							"contactDetails" : contactDetails
						}
						ajaxPost(BASE_URL + "cc/planAndCase/feedback", postParam, function(data) {
							if (data.code == 200) {//查询成功
								app.toast("保存成功");
								$.back();
							} else {//查询失败
								app.toast("保存失败");
							}
						}, function(errorMsg) {
							console.log(JSON.stringify(errorMsg))
						});
					});
				});
			}(mui, document));
		</script>
		<!-- js代码 end -->

	</body>

</html>

